#include"HashTable.h"
template<class K, class T,class Hash = HashFunc<K>>
class my_unordered_set
{
	struct MapKeyOfT
	{
		const K& operator()(const pair<K,T>& kv)
		{
			return kv.first;
		}
	};
	typedef typename hash_bucket::HashTable<K, pair<K,T>, MapKeyOfT, Hash>::iterator iterator;
	typedef typename hash_bucket::HashTable<K, pair<K,T>, MapKeyOfT, Hash>::const_iterator const_iterator;

public:
	iterator begin()
	{
		return _ht.begin();
	}

	iterator end()
	{
		return _ht.end();
	}

	const_iterator begin()const
	{
		return _ht.begin();
	}

	const_iterator end()const
	{
		return _ht.end();
	}

	pair<iterator, bool> insert(const K& key)
	{
		return _ht.Insert(key);
	}

	iterator find(const K& key)
	{
		return _ht.Find(key);
	}

	bool erase(const K& key)
	{
		return _ht.Erase(key);
	}

	T& operator[](const K& key)
	{
		pair<iterator, bool> ret = _ht.Insert(make_pair(key, T()));
		return ret->iterator->second;
	}
private:
	hash_bucket::HashTable<K, pair<K,T>, MapKeyOfT, Hash> _ht;
};